<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

//define globals const
if ($_SERVER['HTTP_HOST'] == 'mtopup.moinhat.vn') {
    define('DOMAIN','http://mtopup.moinhat.vn/');
} else {    
    define('DOMAIN','http://localhost:8080/mtopup/');
}


define('IMG_FOLDER',DOMAIN.'images/');
define('IMG_ICONS_FOLDER',DOMAIN.'images/icons/');
define('IMG_SLIDER_FOLDER',DOMAIN.'images/slider/');
define('IMG_PRO_FOLDER',DOMAIN.'images/products/');
define('IMG_CAT_FOLDER',DOMAIN.'images/categorys/');
define('IMG_LOGO_FOLDER',DOMAIN.'images/logo/');
define('IMG_BANNER_FOLDER',DOMAIN.'images/banner/');
define('CSS_FOLDER',DOMAIN.'css/');
define('JS_FOLDER',DOMAIN.'js/');

//admin const
define('ADMIN_IMG_FOLDER',DOMAIN.'admin/img/');
define('ADMIN_CSS_FOLDER',DOMAIN.'admin/css/');
define('ADMIN_JS_FOLDER',DOMAIN.'admin/js/');
define('CONFIRM_DELETE','Bạn có chắc chắn muốn xoá?');
define('REQUIRED_NOT_NULL','Không được bỏ trống');
define('IS_URL','Link không đúng định dạng');
define('WRONG_TYPE','Chỉ chấp nhận định dạng JPG, JPEG, GIF, PNG');
define('IS_EMAIL','Nhập Email đúng định dạng');




return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Mới Nhất.vn - Nơi hội tụ đam mê công nghệ!',    
	// preloading 'log' component
	'preload'=>array('log'),
    'theme'=>'admin',
    'defaultController'=>'Browser/Index',

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123456',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
            'loginUrl'=>array('Browser/Login'),
		),
        'session' => array(
                        'class' => 'CDbHttpSession',
                        'timeout' => 1800, //30 minutes
        ),
		// uncomment the following to enable URLs in path-format
        'urlManager'=>array(
			'urlFormat'=>'path',
            'urlSuffix'=>'.html',
            'showScriptName'=>false,
			'rules'=>array(
                ''=>'Browser/Index',
				'nap-tien-dien-thoai'=>array('Browser/Services','defaultParams'=>array('id'=>1)),
                'mua-the-dien-thoai'=>array('Browser/Services','defaultParams'=>array('id'=>2)),
                'mua-the-game'=>array('Browser/Services','defaultParams'=>array('id'=>3)),
                'mua-the-skype'=>array('Browser/Services','defaultParams'=>array('id'=>4)),
                'nap-tien-facebook'=>array('Browser/Services','defaultParams'=>array('id'=>5)),
                'lien-he'=>array('Browser/Contact'),
                'tin-khuyen-mai'=>array('Browser/Promotion'),
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
        // uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=abc;dbname=abc',
			'emulatePrepare' => true,
			'username' => 'abc',
			'password' => 'cde',
			'charset' => 'utf8',
		),
       
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'Browser/Error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),        
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'chuvantu@gmail.com',
        'currency'=>' đ',
        'itemsPerPage'=>12,
	),
);